G++ = g++ -std=c++17

G++_FLAG = -Wall -O3

TARGET = video_jpeg
WORK_PATH = ./


CPP = $(wildcard ./*.cpp)
HEAD = -I./ -I./include/ -I./include/onvif_include/

LIBS = -L./lib -lturbojpeg -lonvif -Wl,-rpath=./lib
LIBS += -L./lib/ffmpeg -lavformat -lavutil -lavcodec -lswscale -Wl,-rpath=./lib/ffmpeg

OBJS = $(CPP:.cpp=.o)

.PHONY:all
all : $(TARGET)
$(TARGET) : $(OBJS)
	$(G++) $(G++FLAG) -o $(WORK_PATH)$@ $(OBJS) $(LIBS)

%.o:%.cpp
	$(G++) -c $(G++FLAG) $< -o $@ $(HEAD)

.PHONY:clean
clean:
	rm -f $(TARGET) $(OBJS)
